package hotgammon.gammamon;

import java.util.Map;

import hotgammon.common.Color;
import hotgammon.common.Location;
import hotgammon.common.WinnerStrategy;

public class WinnerStrategyGammamon implements WinnerStrategy {

	@Override
	public Color winner(int turn, Map<Location, Integer> locationCount) {
		
		if (locationCount.containsKey(Location.R_BEAR_OFF)) {
			if (locationCount.get(Location.R_BEAR_OFF) >= 15 ) {
				return Color.RED;
			}
		}
		
		if (locationCount.containsKey(Location.B_BEAR_OFF)) {
			if (locationCount.get(Location.B_BEAR_OFF) >= 15 ) {
				return Color.BLACK;
			}
		}
		
        return Color.NONE; 
	}

}
